package com.njym.java.security.app.rest;

import com.njym.java.security.app.biz.LiveBiz;
import com.njym.java.security.app.entity.FamilyNews;
import com.njym.java.security.app.entity.FamilyUser;
import com.njym.java.security.app.entity.Live;
import com.njym.java.security.common.msg.ObjectRestResponse;
import com.njym.java.security.common.rest.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import tk.mybatis.mapper.entity.Example;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("live")
public class LiveController extends BaseController<LiveBiz,Live> {

    @RequestMapping(value = "/getLists",method = RequestMethod.GET)
    @ResponseBody
    public ObjectRestResponse<FamilyUser> queryFamily(Integer id){
        Example example = new Example(Live.class);
        example.createCriteria();
        example.setOrderByClause("id desc");
        List list =  baseBiz.selectByExample(example);
        return new ObjectRestResponse<FamilyNews>().rel(true).data(list.get(0));

    }


}